package com.wxj.book.cms.controller;

import com.github.pagehelper.PageInfo;
import com.wxj.book.cms.service.ReceiverVoService;
import com.wxj.book.cms.vo.ReceiverVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class ReceiverController {
    @Autowired
    private ReceiverVoService receiverVoService;

    /**
     * 查询所有
     */
    @RequestMapping("receiver/getAll")
    public String getAllReceiver(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                 @RequestParam(value = "pageSize", defaultValue = "20") Integer pageSize,
                                 Model model) {
        PageInfo<ReceiverVo> pageInfo = receiverVoService.getAll(pageNum, pageSize);
        model.addAttribute("pageInfo", pageInfo);
        return "receiver";
    }
}
